//删除所有路点，然后移动
params ["_group", "_pos", ["_dis", 0]];

//删除所有路点
while {(count (waypoints _group)) > 0} do
{
	deleteWaypoint ((waypoints _group) select 0);
};


_group addWaypoint [_pos, _dis, 0];



if(typeName _pos == "OBJECT")then{
	//如果目标在载具内（友军）
	if((side _group) getFriend (side group _pos) > 0.6)then{
		if(vehicle _pos != _pos)then{
			(units _group) allowGetIn true;
			[_group, 0] waypointAttachVehicle (vehicle _pos);
			[_group, 0] setWaypointType "GETIN";
		}else{
			private _unit = leader _group;
			private _veh = vehicle _unit;
			if(_unit != _veh)then{
				moveOut _unit;
				_unit moveInDriver _veh;
				//达到后下车
				[_group, 0] setWaypointStatements ["true", "{ unassignVehicle _x;moveOut _x; } forEach thisList;thisList allowGetIn false;"];
			};
		};
	};
	
};

//[_group, 0] setWaypointType "MOVE";

